package com.yzc.android.network.base;

import com.yzc.android.KDApp;

/**
 * Created by yzc on 16/1/28.
 */
public class VolleyManager {
    private static KDRequestQueue mRequestQueue;

    private VolleyManager() {
        // no instances
    }

    //public static void init(Context context) {
    //    mRequestQueue = new KDRequestQueue(context);
    //}

    public synchronized static KDRequestQueue getRequestQueue() {
        //if (BuildConfig.CURRENT_CONTEXT_MODE_TEST) {
        //    if (mRequestQueue != null) {
        //        return mRequestQueue;
        //    } else {
        //        throw new IllegalStateException("RequestQueue not initialized");
        //    }
        //}
        //else
        //{
        //    return new KDRequestQueue(EDJApp.getGlobalContext());
        //}

        if (mRequestQueue != null) {
            return mRequestQueue;
        }
        else {
            mRequestQueue = new KDRequestQueue(KDApp.getInstance());
            return mRequestQueue;
        }
    }
}
